package com.yan.iftest;

import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 定义本金
        double money;
        // 定义本息总额
        double nummoney;
        // 定义选择的年限变量
       int Duration;
        // 选择期限和本金
        System.out.println("选择期限");
        Duration = scanner.nextInt();
        System.out.println("输入金额");
        money = scanner.nextInt();
        // if语句选择计算
        if(Duration == 1){
            nummoney = money + (money * 2.25/100 * 1);
            System.out.println("本息总额为" + nummoney);
        }
        if(Duration == 2){
            nummoney = money + (money * 2.7/100 * 2);
            System.out.println("本息总额为" + nummoney);
        }
        if(Duration == 3){
            nummoney = money + (money * 3.25/100 * 3);
            System.out.println("本息总额为" + nummoney);
        }
        if(Duration == 5){
            nummoney = money + (money * 3.6/100 * 5);
            System.out.println("本息总额为" + nummoney);
        }

    }
}
